package org.ucas.faker.web.entity.patents;

import org.ucas.faker.web.fetcher.annotation.Connection;
import org.ucas.faker.web.fetcher.annotation.JoinCond;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "patent_agency")
@Connection(table = "patent_meta", conds = {
    @JoinCond(column = "patentId", target = "id")
})
public class PatentAgency {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  @Column(name = "patent_id", nullable = false)
  private Long patentId;

  @Column(name = "agency_id", nullable = false)
  private Long agencyId;

  public PatentAgency(Long patentId, Long agencyId) {
    this.patentId = patentId;
    this.agencyId = agencyId;
  }

  public PatentAgency() {
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getPatentId() {
    return patentId;
  }

  public void setPatentId(Long patentId) {
    this.patentId = patentId;
  }

  public Long getAgencyId() {
    return agencyId;
  }

  public void setAgencyId(Long agencyId) {
    this.agencyId = agencyId;
  }
}
